package net.easymvc.core;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

public class Action {
	protected HttpServletRequest request;
	protected HttpServletResponse response;
	protected HttpSession session;
	private boolean validated=true;
	protected final static int PAGE_SIZE = 10;
	
	public HttpServletRequest getRequest() {
		return request;
	}
	void setRequest(HttpServletRequest request) {
		this.request = request;
	}
	public HttpServletResponse getResponse() {
		return response;
	}
	void setResponse(HttpServletResponse response) {
		this.response = response;
	}
	public HttpSession getSession() {
		return session;
	}
	public void setSession(HttpSession session) {
		this.session = session;
	}
	public void setValidate(boolean b){
		validated=b;
	}
	
	public boolean isValidate(){
		return validated;
	}
	
	public void setRequest(String name,Object value){
		request.setAttribute(name, value);
	}
	public Object getRequest(String name){
		return request.getAttribute(name);
	}
	public void setSession(String name,Object value){
		session.setAttribute(name, value);
	}
	public Object getSession(String name){
		return session.getAttribute(name);
	}
}
